package com.melody.mapper;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.melody.entry.MusicInfo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.melody.model.vo.MusicDetailsVo;
import io.swagger.models.auth.In;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
* @author zxz
* @description 针对表【music_info(歌曲信息表)】的数据库操作Mapper
* @createDate 2025-05-09 10:31:17
* @Entity com.melody.entry.MusicInfo
*/
public interface MusicInfoMapper extends BaseMapper<MusicInfo> {
    /**
     * 通过id查询单个音乐的信息
     * */
    public MusicInfo findMusicById(Integer musicId);

    /**
     * 查询随机5条音乐的信息，用于首页推荐
     * */
    public List<MusicInfo> findRandMusic(@Param("limit") Integer limit);

    /**
     * 插入一条音乐信息
     * */
    public int insertOneMusic(MusicInfo musicInfo);

    /**
     * 插入多条音乐信息
     * */
    public List<MusicInfo> insertManyMusic(List<MusicInfo> musicInfoList);

    public int updateMusicById(MusicInfo musicInfo);

    List<MusicInfo> selectMusicsByLabelId(@Param("labelId") Integer labelId);

}




